feat: build full demo mode for the reference UI#216
Open
SharifIbrahimDev wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #100
What does this PR do?
This PR introduces a comprehensive Demo Mode for the Bridgelet Reference UI. By appending the
?demo=truequery parameter to the application URL, the UI will intercept all backend SDK API calls and return mocked responses via MSW. This allows contributors, developers, and presenters to experience the complete send and claim flows locally without spinning up the backend services.Description
frontend/components/mock-provider.tsxandlayout.tsxto conditionally initialize MSW ifprocess.env.NODE_ENV === 'development'OR if thedemo=truequery parameter is detected.frontend/mocks/handlers/api.tsto mock the core API endpoints (/send,/claim/:token, and/claim/:token/redeem). The mocked responses simulate real-world delays and generate mock claim links containing the?demo=trueflag to persist the demo state across pages.frontend/components/send-form/steps/confirm-step.tsxto call the realcreatePaymentIntentSDK method instead of using a placeholder timeout, enabling it to route directly into our new MSW handlers.docs/demo-mode.mdoutlining how to use Demo Mode, its use-cases, and its limitations (e.g., ephemeral state memory).wallet.ts,bridgelet.ts, andbrowser.tsto ensure the frontend compiles without warnings.Acceptance Criteria met